<form action="{:request()->url()}" autocomplete="off" class="layui-form layui-card" data-auto="true" method="post">
  <div class="layui-card-body padding-left-40">
    <label class="layui-form-item relative block">
      <span class="color-green font-w7 label-required-prev">绑定上级分类</span>
      <span class="color-desc margin-left-5">Category Parent</span>
      <select class='layui-select' lay-search name='nid'>
        {foreach $cates as $cate}
        {eq name='cate.id' value='$vo.nid|default=0'}
        <option selected value='{$cate.id}'>{$cate.spl|raw}{$cate.name}</option>
        {else}
        <option value='{$cate.id}'>{$cate.spl|raw}{$cate.name}</option>
        {/eq}{/foreach}
      </select>
      <span class="help-block"><b>必选，</b>请选择上级分类或顶级分类（目前最多支持{$cateLevel|default=0}级分类）</span>
    </label>
    <label class="layui-form-item relative block">
      <span class="color-green font-w7">分类\工具名称</span>
      <span class="color-desc margin-left-5">Category Name</span>
      <input class="layui-input" name="name" placeholder="请输入分类名称" required value='{$vo.name|default=""}'>
      <span class="help-block"><b>必填，</b>请填写分类名称或工具，建议字符不要太长，一般4-6个汉字（如：系统管理）</span>
    </label>
    <label class="layui-form-item relative block">
      <span class="color-green font-w7">库存</span>
      <span class="color-desc margin-left-5">Stock</span>
      <input class="layui-input" name="stock" placeholder="{$vo.stock|default='库存'}" value="{$vo.stock|default=''}"/>
      <span class="help-block">请填写库存，建议字符不要太长，一般4个汉字</span>
    </label>
    <div class="layui-form-item relative block">
      <span class="color-green font-w7">分类图标</span>
      <span class="color-desc margin-left-5">Category Image</span>
      <label class="relative block">
        <input class="layui-input" name="image" placeholder="请上传商品分类图标&nbsp;&nbsp;&nbsp;&nbsp;" value='{$vo.image|default=""}'>
        <a class="input-right-icon layui-icon layui-icon-upload" data-field="icon" data-file data-type="png,jpg,gif"></a>
      </label>
      <span class="help-block"><b>可选，</b>请上传分类图标\或工具图片，需要是 http 可访问的图片资源链接</span>
    </div>
  </div>
  <div class="hr-line-dashed"></div>
  {notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty}
  <div class="layui-form-item text-center">
    <button class="layui-btn" type='submit'>保存数据</button>
    <button class="layui-btn layui-btn-danger" data-close data-confirm="确定要取消编辑吗？" type='button'>取消编辑</button>
  </div>
  <script>form.render()</script>
</form>